package edu.up.firesawakening;

import edu.up.game.GameConfig;
import edu.up.game.GameMainActivity;
import edu.up.game.GamePlayerType;
import edu.up.game.LocalGame;
import edu.up.game.ProxyGame;
import edu.up.game.ProxyPlayer;

/**
 * The main activity for the Fire's Awakening game
 * 
 * @author Alex Hanemann
 * @author Matt Delaney
 * @author Viet Phan
 * @version 19 November 2012
 */
public class TacticsMainActivity extends GameMainActivity {

	/**
	 * Total number of player types
	 */
	protected static final int NUM_PLAYER_TYPES = 3;

	@Override
	public GameConfig createDefaultConfig() {
		// Define the allowed player types
		GamePlayerType[] playerTypes = new GamePlayerType[NUM_PLAYER_TYPES];
		playerTypes[0] = new GamePlayerType("Local Human Player", false,
				"edu.up.firesawakening.TacticsHumanPlayer");
		playerTypes[1] = new GamePlayerType("Easy AI Player", false,
				"edu.up.firesawakening.TacticsEasyComputerPlayer");
		playerTypes[2] = new GamePlayerType("Moderate AI Player", false,
				"edu.up.firesawakening.TacticsModerateComputerPlayer");

		// Create a game configuration class
		GameConfig defaultConfig = new GameConfig(playerTypes, 2, 2,
				"Fire's Awakening");

		// Add the default players
		defaultConfig.addPlayer("Human", 0);
		defaultConfig.addPlayer("Human 2", 0);

		// done!
		return defaultConfig;
	}

	@Override
	public LocalGame createLocalGame(GameConfig config) {
		// maybe select from a list of maps? or something
		Tile[][] map = null;

		// what map do we want?
		switch (config.getMapSelected()) {
		case 0:
			map = TacticsMapFactory.createMountainPassMap();
			break;
		case 1:
			map = TacticsMapFactory.createBigMap();
			break;
		case 2:
			map = TacticsMapFactory.createDeltaMap();
			break;
		default:
			map = TacticsMapFactory.createBigMap();
			break;
		}
		return new TacticsGame(config, 0, map);
	}

	@Override
	public ProxyPlayer createRemotePlayer() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ProxyGame createRemoteGame(String hostName) {
		// TODO Auto-generated method stub
		return null;
	}

}
